package offer;

import java.util.Arrays;

public class Solution61 {
    public boolean isStraight(int[] nums) {
        int joker = 0;
        Arrays.sort(nums);
        for (int i = 0; i < nums.length; i++) {
            if (nums[i] == 0) {
                joker++;
            } else {
                if (i > 0 && nums[i] == nums[i - 1]) {
                    return false;
                }
            }
        }
        return nums[4] - nums[joker] < 5;
    }
}
